<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{

    /** 随机提取id */
    public static function randId($isRobot=true)
    {
        return self::when($isRobot,function($query){return $query->where('type',2);})->inRandomOrder()->value('id');
    }
}
